-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[RFC] FILTER_THROW_ON_FAILURE #18896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[RFC] FILTER_THROW_ON_FAILURE #18896
Conversation
8c5abca
to
86969e5
Compare
86969e5
to
10dab9e
Compare
#define RETURN_VALIDATION_FAILED \ | ||
if (EG(exception)) { \ | ||
return; \ | ||
return SUCCESS; \ |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this should be success, because success here means that we shouldn't create a new exception for the filter failure
LGTM fwiw. (I don't have access use the actual github review form on php-src, but it lgtm.) |
zend_throw_exception_ex( | ||
php_filter_failed_exception_ce, | ||
0, | ||
"filter validation failed: filter %s not satisfied by %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to use '
around the %s
's? In the error message, you can now end up with a phrase like:
filter validation failed: filter %s not satisfied by elephpants
Which reads as a joke... as it's unclear whether elephpants
are the variable contents that the filter is operating on.
zend_throw_exception_ex( | ||
php_filter_failed_exception_ce, | ||
0, | ||
"filter validation failed: not an array (got %s)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
https://wiki.php.net/rfc/filter_throw_on_failure